home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10250 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  953 b 

  1. Path: news.wyoming.com!usenet
  2. From: dcromley@wyoming.com (Dave Cromley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Class Pointer Array (HELP)
  5. Date: 6 Mar 1996 21:15:52 GMT
  6. Organization: wyoming.com LLC
  7. Message-ID: <4hkva8$rra@horn.wyoming.com>
  8. References: <4hfs8d$a0@nnrp1.news.primenet.com>
  9. NNTP-Posting-Host: cys-cap-6.wyoming.com
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.99.2
  12.  
  13. Brad wrote:
  14. >.. a pointer array of ..
  15. >.. I got this same routine to work with integers, but can't get it 
  16. >to work with the class.  Help!!!
  17.  
  18. There isn't much to go on here, but be sure you have a copy constructor,
  19. since you have pointers.  You can't accept the default copy constructor.
  20. The copy constructor has to make a 'new' item and and use the new
  21. pointer--not just copy the pointer.  Then copy the old item data to
  22. the new item data.
  23.  
  24. I find that using the printf("%4X%4X", ptr) makes for good
  25. debugging--it gives you the hex value of pointers (or anything).
  26.  
  27.   Dave C.
  28.  
  29.